local skynet = require "skynet"
local cluster = require "skynet.cluster"
require "skynet.manager"

local filelog = require "filelog"
local configdao = require "configdao"

skynet.start(function()
	skynet.error("datanode start")
	skynet.newservice("nodelog")
	local confsharesvr = skynet.newservice("confshare")
	skynet.call(confsharesvr, "lua", "start")

	local datanode = configdao.get_cfgsvrs_key("datanode")
	if datanode and datanode.debug_console_port then
		skynet.newservice("debug_console",datanode.debug_console_port)
	end

	skynet.name(".router", skynet.uniqueservice("router") )
	cluster.open("datanode")

	skynet.exit()
end)
